class Timeunit < ActiveRecord::Base
  ID_TO_DATE_PROP = {1 => :hour, 2 => :day, 3 => :month, 4 => :year}
  ID_TO_SQL_FUNC = {1 => "HOUR", 2 => "DAY", 3 => "MONTH", 4 => "YEAR"}

  def to_date_prop
    ID_TO_DATE_PROP[id]
  end
  
  def to_sql_func
    ID_TO_SQL_FUNC[id]
  end
end